# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-sshtunnel
_pkgname=sshtunnel
pkgver=0.1.5
pkgrel=1
pkgdesc='Pure python SSH tunnels.'
url='https://github.com/pahaz/sshtunnel'
arch=('any')
license=('MIT')
depends=('python2' 'python2-paramiko')
makedepends=('git' 'python2-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('ae804865a83bae8443cff1a73b168ffb8aac0c5c4fa6c7a5e142f4f95b4eef34bc7674588fa8797fa35b2685016828bcb137f4102e84ea15089671cf64503d17')

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  mv "$pkgdir/usr/bin/$_pkgname" "$pkgdir/usr/bin/${_pkgname}2"
}

